package com.mdisoft.quotogram;

import java.util.Vector;

import android.app.Activity;
import android.app.ListActivity;
import android.content.pm.ActivityInfo;
import android.net.ParseException;
import android.os.Bundle;
import android.view.LayoutInflater;

import com.mdisoft.quotogram.utils.CustomAdapter;
import com.mdisoft.quotogram.utils.RowData;

public class FeedActivity extends ListActivity
{
	private static final String[] title = new String[] { "Gene Pian" };
	private static final String[] detail = new String[] { "It's me!" };
	private static final String[] imgid = { "http://a0.twimg.com/profile_images/1307288296/IMG_1996_normal.png" };
	private LayoutInflater mInflater;
	private Vector<RowData> data;
	private RowData rd;

	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		setContentView(R.layout.list);
		mInflater = (LayoutInflater) getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
		data = new Vector<RowData>();
		for (int i = 0; i < title.length; i++)
		{
			try
			{
				rd = new RowData(i, title[i], detail[i]);
			}
			catch (ParseException e)
			{
				e.printStackTrace();
			}
			data.add(rd);
		}

		CustomAdapter adapter = new CustomAdapter(this, mInflater, R.layout.list_item, R.id.title,
				data, imgid);
		setListAdapter(adapter);
		getListView().setTextFilterEnabled(true);
	}
}
